package com.gigi.controller;

import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.Response;
import com.gigi.model.CollectDO;
import com.gigi.model.CollectSaveDO;
import com.gigi.model.ListCollectRequest;
import com.gigi.service.manual.CollectManageService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 收藏管理
 */
@RestController
@RequestMapping("collect-manage")
public class CollectManageController {

    private final CollectManageService collectManageService;

    public CollectManageController(CollectManageService collectManageService) {
        this.collectManageService = collectManageService;
    }

    @ApiOperation(value = "列表")
    @PostMapping("/list")
    public MultiResponse<CollectDO> list(@RequestBody ListCollectRequest request) {
        return collectManageService.list(request);
    }

    @ApiOperation(value = "新增/删除")
    @PostMapping("/change")
    public Response change(@RequestBody CollectSaveDO request) {
        return collectManageService.change(request);
    }

}
